Optimal. Leaf size=65 \[ \frac {(2 a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{2 a^{3/2} (a+b)^{3/2}}-\frac {b \cosh (x) \sinh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3263, 12, 3260,
214} \begin {gather*} \frac {(2 a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{2 a^{3/2} (a+b)^{3/2}}-\frac {b \sinh (x) \cosh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 3260
Rule 3263
Rubi steps
\begin {align*} \int \frac {1}{\left (a+b \cosh ^2(x)\right )^2} \, dx &=-\frac {b \cosh (x) \sinh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )}-\frac {\int \frac {-2 a-b}{a+b \cosh ^2(x)} \, dx}{2 a (a+b)}\\ &=-\frac {b \cosh (x) \sinh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )}+\frac {(2 a+b) \int \frac {1}{a+b \cosh ^2(x)} \, dx}{2 a (a+b)}\\ &=-\frac {b \cosh (x) \sinh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )}+\frac {(2 a+b) \text {Subst}\left (\int \frac {1}{a-(a+b) x^2} \, dx,x,\coth (x)\right )}{2 a (a+b)}\\ &=\frac {(2 a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{2 a^{3/2} (a+b)^{3/2}}-\frac {b \cosh (x) \sinh (x)}{2 a (a+b) \left (a+b \cosh ^2(x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 68, normalized size = 1.05 \begin {gather*} \frac {(2 a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{2 a^{3/2} (a+b)^{3/2}}-\frac {b \sinh (2 x)}{2 a (a+b) (2 a+b+b \cosh (2 x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(167\) vs.
\(2(53)=106\).
time = 0.53, size = 168, normalized size = 2.58
method | result | size |
default | \(-\frac {2 \left (\frac {b \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{2 a \left (a +b \right )}+\frac {b \tanh \left (\frac {x}{2}\right )}{2 a \left (a +b \right )}\right )}{a \left (\tanh ^{4}\left (\frac {x}{2}\right )\right )+b \left (\tanh ^{4}\left (\frac {x}{2}\right )\right )-2 a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+a +b}-\frac {\left (2 a +b \right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}\right )}{a \left (a +b \right )}\) | \(168\) |
risch | \(\frac {2 \,{\mathrm e}^{2 x} a +b \,{\mathrm e}^{2 x}+b}{a \left (a +b \right ) \left ({\mathrm e}^{4 x} b +4 \,{\mathrm e}^{2 x} a +2 b \,{\mathrm e}^{2 x}+b \right )}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}-2 a^{2}-2 a b}{b \sqrt {a^{2}+a b}}\right )}{2 \sqrt {a^{2}+a b}\, \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}-2 a^{2}-2 a b}{b \sqrt {a^{2}+a b}}\right ) b}{4 \sqrt {a^{2}+a b}\, \left (a +b \right ) a}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}+2 a^{2}+2 a b}{b \sqrt {a^{2}+a b}}\right )}{2 \sqrt {a^{2}+a b}\, \left (a +b \right )}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}+2 a^{2}+2 a b}{b \sqrt {a^{2}+a b}}\right ) b}{4 \sqrt {a^{2}+a b}\, \left (a +b \right ) a}\) | \(330\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (53) = 106\).
time = 0.49, size = 134, normalized size = 2.06 \begin {gather*} -\frac {{\left (2 \, a + b\right )} \log \left (\frac {b e^{\left (-2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (-2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{4 \, \sqrt {{\left (a + b\right )} a} {\left (a^{2} + a b\right )}} - \frac {{\left (2 \, a + b\right )} e^{\left (-2 \, x\right )} + b}{a^{2} b + a b^{2} + 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} e^{\left (-2 \, x\right )} + {\left (a^{2} b + a b^{2}\right )} e^{\left (-4 \, x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 539 vs.
\(2 (53) = 106\).
time = 0.40, size = 1239, normalized size = 19.06 \begin {gather*} \left [\frac {4 \, a^{2} b + 4 \, a b^{2} + 4 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2} + 8 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 4 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \sinh \left (x\right )^{2} + {\left ({\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (2 \, a b + b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (4 \, a^{2} + 4 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, a^{2} + 4 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, a b + b^{2} + 4 \, {\left ({\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{3} + {\left (4 \, a^{2} + 4 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \sqrt {a^{2} + a b} \log \left (\frac {b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (x\right )^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + 8 \, a^{2} + 8 \, a b + b^{2} + 4 \, {\left (b^{2} \cosh \left (x\right )^{3} + {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) - 4 \, {\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + 2 \, a + b\right )} \sqrt {a^{2} + a b}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right )}{4 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3} + {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3} + 3 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{3} + {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )}}, \frac {2 \, a^{2} b + 2 \, a b^{2} + 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 2 \, {\left (2 \, a^{3} + 3 \, a^{2} b + a b^{2}\right )} \sinh \left (x\right )^{2} + {\left ({\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (2 \, a b + b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (4 \, a^{2} + 4 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, a^{2} + 4 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, a b + b^{2} + 4 \, {\left ({\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{3} + {\left (4 \, a^{2} + 4 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \sqrt {-a^{2} - a b} \arctan \left (\frac {{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + 2 \, a + b\right )} \sqrt {-a^{2} - a b}}{2 \, {\left (a^{2} + a b\right )}}\right )}{2 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3} + {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3} + 3 \, {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )^{3} + {\left (2 \, a^{5} + 5 \, a^{4} b + 4 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 104, normalized size = 1.60 \begin {gather*} \frac {{\left (2 \, a + b\right )} \arctan \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt {-a^{2} - a b}}\right )}{2 \, {\left (a^{2} + a b\right )} \sqrt {-a^{2} - a b}} + \frac {2 \, a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + b}{{\left (a^{2} + a b\right )} {\left (b e^{\left (4 \, x\right )} + 4 \, a e^{\left (2 \, x\right )} + 2 \, b e^{\left (2 \, x\right )} + b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {1}{{\left (b\,{\mathrm {cosh}\left (x\right )}^2+a\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________